package lec04.am;

import lec03.am.p1.Point;

class A {
	final void f() {
	}

	void g(A a) {
		a=new A();//ok
	}

	void h(final A a) {
		// a=new A();//ce
	}
}

final class B extends A {
	// void f(){}//ERROR:Cannot override the final method from A
}

// class C extends B{}//The type C cannot subclass the final class B
public class FinalDemo {
	public static void main(String[] args) {
		final int x = 3;
		// x++;//ERROR:The final local variable x cannot be assigned.
		final Point t = new Point(3, 4);
		System.out.println(t);
		t.setX(5);
		System.out.println(t);
		// t=new Point(5,6);//ERROR:The final local variable t cannot be
		// assigned.
		Point q = new Point();
		final Point r = q;
		System.out.println(r);
		q = new Point(5, 6);
		System.out.println(r);

	}
}
